package domain;

import java.util.Date;
import java.util.Objects;

/**
 * 账户类
 *
 * @author liujiale
 */
public class Account {

    /** 用户名 */
    private String username;

    /** 密码 */
    private String password;

    /** 昵称 */
    private String nickname;

    /** 电话号码 */
    private String telephone;

    /** 邮箱 */
    private String email;

    /** 创建时间 */
    private Date createTime;

    /**
     * 空构造函数
     */
    public Account() {
    }

    /**
     * 构造函数
     *
     * @param username   用户名
     * @param password   密码
     * @param nickname   昵称
     * @param telephone  电话号码
     * @param email      邮箱
     * @param createTime 账户创建时间
     */
    public Account(String username, String password, String nickname, String telephone, String email, Date createTime) {
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.telephone = telephone;
        this.email = email;
        this.createTime = createTime;
    }

    /**
     * Gets username.
     *
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * Sets username.
     *
     * @param username the username
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * Gets password.
     *
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * Sets password.
     *
     * @param password the password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * Gets nickname.
     *
     * @return the nickname
     */
    public String getNickname() {
        return nickname;
    }

    /**
     * Sets nickname.
     *
     * @param nickname the nickname
     */
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    /**
     * Gets telephone.
     *
     * @return the telephone
     */
    public String getTelephone() {
        return telephone;
    }

    /**
     * Sets telephone.
     *
     * @param telephone the telephone
     */
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    /**
     * Gets email.
     *
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * Sets email.
     *
     * @param email the email
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * Gets create time.
     *
     * @return the create time
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * Sets create time.
     *
     * @param createTime the create time
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Account)) {
            return false;
        }
        Account account = (Account) o;
        return Objects.equals(username, account.username) && Objects.equals(password, account.password) && Objects.equals(nickname, account.nickname) && Objects.equals(telephone, account.telephone) && Objects.equals(email, account.email) && Objects.equals(createTime, account.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(username, password, nickname, telephone, email, createTime);
    }

    @Override
    public String toString() {
        return "Account{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", telephone='" + telephone + '\'' +
                ", email='" + email + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
